package com.ssy.lingxi.system.dao;

import com.ssy.lingxi.system.entity.ShopConfig;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ShopConfigRepository extends JpaRepository<ShopConfig, Long> {

    Boolean existsByName(String name);

    Boolean existsAllByTypeAndEnvironment(Integer type, Integer environment);

    List<ShopConfig> findByState(Integer state);

    List<ShopConfig> findByIdInAndEnvironmentAndStateAndTypeInAndSelf(List<Long> shopIdList, Integer environment, Integer state, List<Integer> types, Integer self);

    List<ShopConfig> findByEnvironmentAndTypeAndProperty(Integer environment, Integer type, Integer property);

    Boolean existsAllByTypeAndEnvironmentAndIsDefault(Integer type, Integer environment, int isDefault);

    List<ShopConfig> findByEnvironmentAndType(Integer environment, Integer type);
}
